PostgreSQL provides four kinds of functions:
- query language functions (functions written in SQL)
- procedural language functions (functions written in, for example, PL/Tcl or PL/pgSQL)
- internal functions
- C-language functions
Every kind of function can take base types, composite types, or combinations of these as arguments (parameters). In addition, every kind of function can return a base type or a composite type. Many kinds of functions can take or return certain pseudo-types (such as polymorphic types), but the available facilities vary.
Just simply click to open an object pane for Function.
A control-click displays the popup menu or using the object pane
toolbar below, allowing you to create new, edit and delete the selected function.
Create Function
To create a new function
- Select anywhere on the object pane.
- Click the
from the object pane toolbar.
or - Control-click and select New Function from the popup menu.
- Edit function properties on the appropriate tabs of the Function Designer.
Hint: To create new function you can also control-click the Function node of the navigation pane and select the New Function from the popup menu.
To create a new function with the same properties as one of the existing function has (using drag and drop method)
Apply to: current schema {same connection and database}
- Select the function(s) for copying in the navigation pane/object pane.
- Drag and drop the chosen function(s) to the object pane.
- Select one of the following options:
- Copy
- Cancel
- The newly created function(s) will be named as "functionname_copy".
Apply to: different database {same connection} different database {different connection} (Data Transfer tool will be activated)
- Select the function(s) for copying in the object pane.
- Drag and drop the chosen function(s) to the target database.
- Select one of the following options:
- Copy
- Cancel
- Control-click the function in the navigation pane or object pane and choose Duplicate Function.
- The newly created function will be named as "functionname_copy".
To create a new function with modification as one of the existing function
- Select the function for modifying in the navigation pane/object pane.
- Control-click and select the Design
Function from the popup menu or simply double-click the function.
or - Click the
from the object pane toolbar.
- Modify function properties on the appropriate tabs of the Function Designer.
- Click
Save As.
To edit the existing function (manage its properties etc)
- Select the function for editing in the navigation pane/object pane.
- Control-click and select the Design Function
from the popup menu or simply double-click the function.
or - Click the
from the object pane toolbar.
- Edit function properties on the appropriate tabs of the Function Designer.
To change the name of the function
- Select the function for editing in the navigation pane/object pane.
- Control-click and select the Rename from the popup menu.
Run Function
To run a function in the navigation pane/object pane
- Select the function for executing in the navigation pane/object pane.
- Click the Execute from the object pane toolbar.
or - Control-click and select Execute Function from the popup menu.
- View/edit the returned data on the Result tab.
To run a function in the Function Designer
- Create a new function or open the existing function.
- Click
Execute.
- View/edit the returned data on the Result tab.
Delete Function
To delete a function
- Select the function for deleting in the navigation pane/object pane.
- Control-click and select the Delete Function
from the popup menu.
or - Click the
from the object pane toolbar.
- Confirm deleting in the dialog window.
Achieve Function Information
To achieve a function information
- Select the function in the navigation pane/object pane.
- Choose View -> Object Information in the main menu.
or - Click the
from the object pane toolbar.